var classes = [];
var classDetail = {
	// className,
	// status,
	// point,
	// people,
	// maxPeople,
	// teacher,
	// teacherStatus,
	// department,
	// class,
	// grade,
	// book,
	// other,
	// year,
	// term,
	// time,
	// week,
	// lastTime,
	// classTime,
	// position,
	// timeAndPosition,
	// kind,
	// remark
};
var a = document.querySelectorAll(".listTable tr");
for(i=1;i<a.length;i++){
	var count = 0;
	var classDetail = {};
	for(j=0;j<a[i].childNodes.length;j++){
		var index = a[i].childNodes[j].innerHTML;
		if(index){
			switch(count){
			case 0:classDetail.className = index;
				break;
				case 1:classDetail.point = index;
				break;
				case 3:classDetail.teacher = index;
				break;
				case 4:classDetail.teacherStatus = index;
				break;
				case 5:classDetail.department = index;
				break;
				case 6:classDetail.other = index;
				break;
				case 7:classDetail.year = index;
				break;
				case 8:classDetail.term = index;
				break;
				case 9:
				//a[i].childNodes[j].childNodes
				for(k=0;k<a[i].childNodes[j].childNodes.length;k++){
					var tempData = a[i].childNodes[j].childNodes[k].innerHTML;
					if(tempData){
						//var b = tempData.replace(/[\r\n\t\/ ]/g,"");
						classDetail.timeAndPosition = tempData.replace(/[\r\n\t\/ ]/g,"");
						// classDetail.week = b.split(":")[0];
						// classDetail.lastTime = b.split(":")[1].split(";")[0];
						// classDetail.classTime = b.split(":")[1].split(";")[1].split(",")[0];
						//classDetail.position = b.split(":")[1].split(";")[1].split(",")[1] + b.split(":")[1].split(";")[1].split(",")[2];
					}
				}
				break;
				case 10:
				for(k=0;k<a[i].childNodes[j].childNodes.length;k++){
					var tempData = a[i].childNodes[j].childNodes[k].innerHTML;
					if(tempData){
						classDetail.kind = tempData.replace(/[\r\n\t\/ ]/g,"");
					}
				}
				break;
				default:
				break;
			}
			count++;
		}
	}
	classes.push(classDetail);
}
JSON.stringify(classes);
var node=document.createElement("div");
document.body.appendChild(node);
for(i=0;i<classes.length;i++){
	for(var key in classes[i]){
		if(typeof(classes[i][key]) == "string"){
			node.innerHTML += key + ":" + classes[i][key];
			node.innerHTML += "<br>";
		}
	}
}
